3.3.16 \(\int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx\) [216]

3.3.16.1 Optimal result
3.3.16.2 Mathematica [C] (warning: unable to verify)
3.3.16.3 Rubi [A] (verified)
3.3.16.4 Maple [A] (verified)
3.3.16.5 Fricas [B] (verification not implemented)
3.3.16.6 Sympy [F]
3.3.16.7 Maxima [F(-2)]
3.3.16.8 Giac [A] (verification not implemented)
3.3.16.9 Mupad [B] (verification not implemented)

3.3.16.1 Optimal result

Integrand size = 31, antiderivative size = 207 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=-\frac {3 d \left (2 c^2+2 c d+d^2\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{a (c-d)^{7/2} (c+d)^{5/2} f}+\frac {d (2 c+3 d) \tan (e+f x)}{2 a (c-d)^2 (c+d) f (c+d \sec (e+f x))^2}+\frac {\tan (e+f x)}{(c-d) f (a+a \sec (e+f x)) (c+d \sec (e+f x))^2}+\frac {d (2 c+d) (c+4 d) \tan (e+f x)}{2 a (c-d)^3 (c+d)^2 f (c+d \sec (e+f x))} \]

output
-3*d*(2*c^2+2*c*d+d^2)*arctanh((c-d)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d)^(1/2)) 
/a/(c-d)^(7/2)/(c+d)^(5/2)/f+1/2*d*(2*c+3*d)*tan(f*x+e)/a/(c-d)^2/(c+d)/f/ 
(c+d*sec(f*x+e))^2+tan(f*x+e)/(c-d)/f/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^2+ 
1/2*d*(2*c+d)*(c+4*d)*tan(f*x+e)/a/(c-d)^3/(c+d)^2/f/(c+d*sec(f*x+e))
 
3.3.16.2 Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 7.45 (sec) , antiderivative size = 1422, normalized size of antiderivative = 6.87 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx =\text {Too large to display} \]

input
Integrate[Sec[e + f*x]/((a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])^3),x]
 
output
((2*c^2 + 2*c*d + d^2)*Cos[e/2 + (f*x)/2]^2*(d + c*Cos[e + f*x])^3*Sec[e + 
 f*x]^4*(((-6*I)*d*ArcTan[Sec[(f*x)/2]*(Cos[e]/(Sqrt[c^2 - d^2]*Sqrt[Cos[2 
*e] - I*Sin[2*e]]) - (I*Sin[e])/(Sqrt[c^2 - d^2]*Sqrt[Cos[2*e] - I*Sin[2*e 
]]))*((-I)*d*Sin[(f*x)/2] + I*c*Sin[e + (f*x)/2])]*Cos[e])/(Sqrt[c^2 - d^2 
]*f*Sqrt[Cos[2*e] - I*Sin[2*e]]) - (6*d*ArcTan[Sec[(f*x)/2]*(Cos[e]/(Sqrt[ 
c^2 - d^2]*Sqrt[Cos[2*e] - I*Sin[2*e]]) - (I*Sin[e])/(Sqrt[c^2 - d^2]*Sqrt 
[Cos[2*e] - I*Sin[2*e]]))*((-I)*d*Sin[(f*x)/2] + I*c*Sin[e + (f*x)/2])]*Si 
n[e])/(Sqrt[c^2 - d^2]*f*Sqrt[Cos[2*e] - I*Sin[2*e]])))/((-c + d)^3*(c + d 
)^2*(a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])^3) + (Cos[e/2 + (f*x)/2]*(d 
+ c*Cos[e + f*x])*Sec[e/2]*Sec[e]*Sec[e + f*x]^4*(8*c^5*d*Sin[(f*x)/2] + 1 
0*c^4*d^2*Sin[(f*x)/2] - 11*c^3*d^3*Sin[(f*x)/2] - 17*c^2*d^4*Sin[(f*x)/2] 
 - 2*c*d^5*Sin[(f*x)/2] + 2*d^6*Sin[(f*x)/2] - 8*c^5*d*Sin[(3*f*x)/2] - 22 
*c^4*d^2*Sin[(3*f*x)/2] - 27*c^3*d^3*Sin[(3*f*x)/2] - 5*c^2*d^4*Sin[(3*f*x 
)/2] + 2*c*d^5*Sin[(3*f*x)/2] + 4*c^6*Sin[e - (f*x)/2] + 8*c^5*d*Sin[e - ( 
f*x)/2] + 18*c^4*d^2*Sin[e - (f*x)/2] + 35*c^3*d^3*Sin[e - (f*x)/2] + 25*c 
^2*d^4*Sin[e - (f*x)/2] + 2*c*d^5*Sin[e - (f*x)/2] - 2*d^6*Sin[e - (f*x)/2 
] - 4*c^6*Sin[e + (f*x)/2] - 8*c^5*d*Sin[e + (f*x)/2] - 6*c^4*d^2*Sin[e + 
(f*x)/2] - 7*c^3*d^3*Sin[e + (f*x)/2] + 5*c^2*d^4*Sin[e + (f*x)/2] + 2*c*d 
^5*Sin[e + (f*x)/2] - 2*d^6*Sin[e + (f*x)/2] + 8*c^5*d*Sin[2*e + (f*x)/2] 
+ 22*c^4*d^2*Sin[2*e + (f*x)/2] + 17*c^3*d^3*Sin[2*e + (f*x)/2] + 13*c^...
 
3.3.16.3 Rubi [A] (verified)

Time = 0.51 (sec) , antiderivative size = 328, normalized size of antiderivative = 1.58, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.323, Rules used = {3042, 4475, 114, 27, 168, 27, 169, 27, 104, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sec (e+f x)}{(a \sec (e+f x)+a) (c+d \sec (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\csc \left (e+f x+\frac {\pi }{2}\right )}{\left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right ) \left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )^3}dx\)

\(\Big \downarrow \) 4475

\(\displaystyle -\frac {a^2 \tan (e+f x) \int \frac {1}{\sqrt {a-a \sec (e+f x)} (\sec (e+f x) a+a)^{3/2} (c+d \sec (e+f x))^3}d\sec (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 114

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\int \frac {a^2 (2 c+d-2 d \sec (e+f x))}{\sqrt {a-a \sec (e+f x)} (\sec (e+f x) a+a)^{3/2} (c+d \sec (e+f x))^2}d\sec (e+f x)}{2 a^2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\int \frac {2 c+d-2 d \sec (e+f x)}{\sqrt {a-a \sec (e+f x)} (\sec (e+f x) a+a)^{3/2} (c+d \sec (e+f x))^2}d\sec (e+f x)}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 168

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {\int \frac {a^2 ((c+d) (2 c+3 d)-d (4 c+d) \sec (e+f x))}{\sqrt {a-a \sec (e+f x)} (\sec (e+f x) a+a)^{3/2} (c+d \sec (e+f x))}d\sec (e+f x)}{a^2 \left (c^2-d^2\right )}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {\int \frac {(c+d) (2 c+3 d)-d (4 c+d) \sec (e+f x)}{\sqrt {a-a \sec (e+f x)} (\sec (e+f x) a+a)^{3/2} (c+d \sec (e+f x))}d\sec (e+f x)}{c^2-d^2}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 169

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {-\frac {\int \frac {3 a^2 d \left (2 c^2+2 d c+d^2\right )}{\sqrt {a-a \sec (e+f x)} \sqrt {\sec (e+f x) a+a} (c+d \sec (e+f x))}d\sec (e+f x)}{a^3 (c-d)}-\frac {(2 c+d) (c+4 d) \sqrt {a-a \sec (e+f x)}}{a^2 (c-d) \sqrt {a \sec (e+f x)+a}}}{c^2-d^2}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {-\frac {3 d \left (2 c^2+2 c d+d^2\right ) \int \frac {1}{\sqrt {a-a \sec (e+f x)} \sqrt {\sec (e+f x) a+a} (c+d \sec (e+f x))}d\sec (e+f x)}{a (c-d)}-\frac {(2 c+d) (c+4 d) \sqrt {a-a \sec (e+f x)}}{a^2 (c-d) \sqrt {a \sec (e+f x)+a}}}{c^2-d^2}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 104

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {-\frac {6 d \left (2 c^2+2 c d+d^2\right ) \int \frac {1}{a (c-d)+\frac {a (c+d) (\sec (e+f x) a+a)}{a-a \sec (e+f x)}}d\frac {\sqrt {\sec (e+f x) a+a}}{\sqrt {a-a \sec (e+f x)}}}{a (c-d)}-\frac {(2 c+d) (c+4 d) \sqrt {a-a \sec (e+f x)}}{a^2 (c-d) \sqrt {a \sec (e+f x)+a}}}{c^2-d^2}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

\(\Big \downarrow \) 218

\(\displaystyle -\frac {a^2 \tan (e+f x) \left (\frac {\frac {-\frac {6 d \left (2 c^2+2 c d+d^2\right ) \arctan \left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{a^2 (c-d)^{3/2} \sqrt {c+d}}-\frac {(2 c+d) (c+4 d) \sqrt {a-a \sec (e+f x)}}{a^2 (c-d) \sqrt {a \sec (e+f x)+a}}}{c^2-d^2}+\frac {d (4 c+d) \sqrt {a-a \sec (e+f x)}}{a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))}}{2 \left (c^2-d^2\right )}+\frac {d \sqrt {a-a \sec (e+f x)}}{2 a^2 \left (c^2-d^2\right ) \sqrt {a \sec (e+f x)+a} (c+d \sec (e+f x))^2}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}\)

input
Int[Sec[e + f*x]/((a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])^3),x]
 
output
-((a^2*((d*Sqrt[a - a*Sec[e + f*x]])/(2*a^2*(c^2 - d^2)*Sqrt[a + a*Sec[e + 
 f*x]]*(c + d*Sec[e + f*x])^2) + ((d*(4*c + d)*Sqrt[a - a*Sec[e + f*x]])/( 
a^2*(c^2 - d^2)*Sqrt[a + a*Sec[e + f*x]]*(c + d*Sec[e + f*x])) + ((-6*d*(2 
*c^2 + 2*c*d + d^2)*ArcTan[(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c 
- d]*Sqrt[a - a*Sec[e + f*x]])])/(a^2*(c - d)^(3/2)*Sqrt[c + d]) - ((2*c + 
 d)*(c + 4*d)*Sqrt[a - a*Sec[e + f*x]])/(a^2*(c - d)*Sqrt[a + a*Sec[e + f* 
x]]))/(c^2 - d^2))/(2*(c^2 - d^2)))*Tan[e + f*x])/(f*Sqrt[a - a*Sec[e + f* 
x]]*Sqrt[a + a*Sec[e + f*x]]))
 

3.3.16.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 104
Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x 
_)), x_] :> With[{q = Denominator[m]}, Simp[q   Subst[Int[x^(q*(m + 1) - 1) 
/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^(1/q)], x] 
] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && L 
tQ[-1, m, 0] && SimplerQ[a + b*x, c + d*x]
 

rule 114
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Simp[b*(a + b*x)^(m + 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1 
)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + Simp[1/((m + 1)*(b*c - a*d)*(b*e 
 - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*(m + 1) 
 - b*(d*e*(m + n + 2) + c*f*(m + p + 2)) - b*d*f*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && ILtQ[m, -1] && (IntegerQ[n] || 
 IntegersQ[2*n, 2*p] || ILtQ[m + n + p + 3, 0])
 

rule 168
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_)*((g_.) + (h_.)*(x_)), x_] :> Simp[(b*g - a*h)*(a + b*x)^(m + 1)*(c + 
 d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + S 
imp[1/((m + 1)*(b*c - a*d)*(b*e - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n 
*(e + f*x)^p*Simp[(a*d*f*g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a* 
h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && ILtQ[m, -1]
 

rule 169
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_)*((g_.) + (h_.)*(x_)), x_] :> Simp[(b*g - a*h)*(a + b*x)^(m + 1)*(c + 
 d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + S 
imp[1/((m + 1)*(b*c - a*d)*(b*e - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n 
*(e + f*x)^p*Simp[(a*d*f*g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a* 
h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && LtQ[m, -1] && IntegersQ[ 
2*m, 2*n, 2*p]
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4475
Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_), x_Symbol] :> Simp[a 
^2*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]])) 
 Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*((c + d*x)^n/Sqrt[a - b*x]), x 
], x, Csc[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[ 
b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p, 1] || In 
tegerQ[m - 1/2])
 
3.3.16.4 Maple [A] (verified)

Time = 0.99 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.07

method result size
derivativedivides \(\frac {\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}}+\frac {2 d \left (\frac {-\frac {3 d \left (2 c^{2}-c d -d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 \left (c^{2}+2 c d +d^{2}\right )}+\frac {d \left (6 c +d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 c +2 d}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{2}}-\frac {3 \left (2 c^{2}+2 c d +d^{2}\right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{2 \left (c^{2}+2 c d +d^{2}\right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c -d \right )^{3}}}{f a}\) \(221\)
default \(\frac {\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}}+\frac {2 d \left (\frac {-\frac {3 d \left (2 c^{2}-c d -d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 \left (c^{2}+2 c d +d^{2}\right )}+\frac {d \left (6 c +d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 c +2 d}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{2}}-\frac {3 \left (2 c^{2}+2 c d +d^{2}\right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{2 \left (c^{2}+2 c d +d^{2}\right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c -d \right )^{3}}}{f a}\) \(221\)
risch \(\frac {i \left (2 d^{6} {\mathrm e}^{2 i \left (f x +e \right )}+c^{2} d^{4}-4 c^{5} d -2 c^{3} d^{3}-8 c^{4} d^{2}-2 c^{6}-2 c \,d^{5} {\mathrm e}^{2 i \left (f x +e \right )}-7 c^{3} d^{3} {\mathrm e}^{4 i \left (f x +e \right )}-2 c^{2} d^{4} {\mathrm e}^{4 i \left (f x +e \right )}+2 c \,d^{5} {\mathrm e}^{4 i \left (f x +e \right )}-8 c^{5} d \,{\mathrm e}^{3 i \left (f x +e \right )}+2 c \,d^{5} {\mathrm e}^{i \left (f x +e \right )}-22 c^{4} d^{2} {\mathrm e}^{3 i \left (f x +e \right )}-17 c^{3} d^{3} {\mathrm e}^{3 i \left (f x +e \right )}-8 c^{5} d \,{\mathrm e}^{i \left (f x +e \right )}-22 c^{4} d^{2} {\mathrm e}^{i \left (f x +e \right )}-27 c^{3} d^{3} {\mathrm e}^{i \left (f x +e \right )}-5 c^{2} d^{4} {\mathrm e}^{i \left (f x +e \right )}-13 c^{2} d^{4} {\mathrm e}^{3 i \left (f x +e \right )}-2 c \,d^{5} {\mathrm e}^{3 i \left (f x +e \right )}-8 c^{5} d \,{\mathrm e}^{2 i \left (f x +e \right )}-4 c^{5} d \,{\mathrm e}^{4 i \left (f x +e \right )}-2 c^{4} d^{2} {\mathrm e}^{4 i \left (f x +e \right )}-18 c^{4} d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-35 c^{3} d^{3} {\mathrm e}^{2 i \left (f x +e \right )}-25 c^{2} d^{4} {\mathrm e}^{2 i \left (f x +e \right )}+2 d^{6} {\mathrm e}^{3 i \left (f x +e \right )}-4 c^{6} {\mathrm e}^{2 i \left (f x +e \right )}-2 c^{6} {\mathrm e}^{4 i \left (f x +e \right )}\right )}{c^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{2 i \left (f x +e \right )} c +2 d \,{\mathrm e}^{i \left (f x +e \right )}+c \right )^{2} a \left (-c +d \right )^{3} f \left (c +d \right )^{2}}+\frac {3 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i c^{2}-i d^{2}-\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) c^{2}}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}+\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i c^{2}-i d^{2}-\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) c}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}+\frac {3 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-\frac {i c^{2}-i d^{2}-\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right )}{2 \sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}-\frac {3 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) c^{2}}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}-\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) c}{\sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}-\frac {3 d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right )}{2 \sqrt {c^{2}-d^{2}}\, \left (c +d \right )^{2} \left (c -d \right )^{3} f a}\) \(1007\)

input
int(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^3,x,method=_RETURNVERBOSE 
)
 
output
1/f/a*(tan(1/2*f*x+1/2*e)/(c^3-3*c^2*d+3*c*d^2-d^3)+2*d/(c-d)^3*((-3/2*d*( 
2*c^2-c*d-d^2)/(c^2+2*c*d+d^2)*tan(1/2*f*x+1/2*e)^3+1/2*d*(6*c+d)/(c+d)*ta 
n(1/2*f*x+1/2*e))/(tan(1/2*f*x+1/2*e)^2*c-tan(1/2*f*x+1/2*e)^2*d-c-d)^2-3/ 
2*(2*c^2+2*c*d+d^2)/(c^2+2*c*d+d^2)/((c+d)*(c-d))^(1/2)*arctanh((c-d)*tan( 
1/2*f*x+1/2*e)/((c+d)*(c-d))^(1/2))))
 
3.3.16.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 637 vs. \(2 (194) = 388\).

Time = 0.36 (sec) , antiderivative size = 1331, normalized size of antiderivative = 6.43 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=\text {Too large to display} \]

input
integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="fri 
cas")
 
output
[-1/4*(3*(2*c^2*d^3 + 2*c*d^4 + d^5 + (2*c^4*d + 2*c^3*d^2 + c^2*d^3)*cos( 
f*x + e)^3 + (2*c^4*d + 6*c^3*d^2 + 5*c^2*d^3 + 2*c*d^4)*cos(f*x + e)^2 + 
(4*c^3*d^2 + 6*c^2*d^3 + 4*c*d^4 + d^5)*cos(f*x + e))*sqrt(c^2 - d^2)*log( 
(2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d* 
cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d* 
cos(f*x + e) + d^2)) - 2*(2*c^4*d^2 + 9*c^3*d^3 + 2*c^2*d^4 - 9*c*d^5 - 4* 
d^6 + (2*c^6 + 4*c^5*d + 6*c^4*d^2 - 2*c^3*d^3 - 9*c^2*d^4 - 2*c*d^5 + d^6 
)*cos(f*x + e)^2 + (4*c^5*d + 14*c^4*d^2 + 7*c^3*d^3 - 13*c^2*d^4 - 11*c*d 
^5 - d^6)*cos(f*x + e))*sin(f*x + e))/((a*c^9 - a*c^8*d - 3*a*c^7*d^2 + 3* 
a*c^6*d^3 + 3*a*c^5*d^4 - 3*a*c^4*d^5 - a*c^3*d^6 + a*c^2*d^7)*f*cos(f*x + 
 e)^3 + (a*c^9 + a*c^8*d - 5*a*c^7*d^2 - 3*a*c^6*d^3 + 9*a*c^5*d^4 + 3*a*c 
^4*d^5 - 7*a*c^3*d^6 - a*c^2*d^7 + 2*a*c*d^8)*f*cos(f*x + e)^2 + (2*a*c^8* 
d - a*c^7*d^2 - 7*a*c^6*d^3 + 3*a*c^5*d^4 + 9*a*c^4*d^5 - 3*a*c^3*d^6 - 5* 
a*c^2*d^7 + a*c*d^8 + a*d^9)*f*cos(f*x + e) + (a*c^7*d^2 - a*c^6*d^3 - 3*a 
*c^5*d^4 + 3*a*c^4*d^5 + 3*a*c^3*d^6 - 3*a*c^2*d^7 - a*c*d^8 + a*d^9)*f), 
-1/2*(3*(2*c^2*d^3 + 2*c*d^4 + d^5 + (2*c^4*d + 2*c^3*d^2 + c^2*d^3)*cos(f 
*x + e)^3 + (2*c^4*d + 6*c^3*d^2 + 5*c^2*d^3 + 2*c*d^4)*cos(f*x + e)^2 + ( 
4*c^3*d^2 + 6*c^2*d^3 + 4*c*d^4 + d^5)*cos(f*x + e))*sqrt(-c^2 + d^2)*arct 
an(-sqrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*sin(f*x + e))) - (2 
*c^4*d^2 + 9*c^3*d^3 + 2*c^2*d^4 - 9*c*d^5 - 4*d^6 + (2*c^6 + 4*c^5*d +...
 
3.3.16.6 Sympy [F]

\[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=\frac {\int \frac {\sec {\left (e + f x \right )}}{c^{3} \sec {\left (e + f x \right )} + c^{3} + 3 c^{2} d \sec ^{2}{\left (e + f x \right )} + 3 c^{2} d \sec {\left (e + f x \right )} + 3 c d^{2} \sec ^{3}{\left (e + f x \right )} + 3 c d^{2} \sec ^{2}{\left (e + f x \right )} + d^{3} \sec ^{4}{\left (e + f x \right )} + d^{3} \sec ^{3}{\left (e + f x \right )}}\, dx}{a} \]

input
integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))**3,x)
 
output
Integral(sec(e + f*x)/(c**3*sec(e + f*x) + c**3 + 3*c**2*d*sec(e + f*x)**2 
 + 3*c**2*d*sec(e + f*x) + 3*c*d**2*sec(e + f*x)**3 + 3*c*d**2*sec(e + f*x 
)**2 + d**3*sec(e + f*x)**4 + d**3*sec(e + f*x)**3), x)/a
 
3.3.16.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=\text {Exception raised: ValueError} \]

input
integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="max 
ima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?` f 
or more de
 
3.3.16.8 Giac [A] (verification not implemented)

Time = 0.38 (sec) , antiderivative size = 362, normalized size of antiderivative = 1.75 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=-\frac {\frac {3 \, {\left (2 \, c^{2} d + 2 \, c d^{2} + d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, c + 2 \, d\right ) + \arctan \left (-\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )}}{{\left (a c^{5} - a c^{4} d - 2 \, a c^{3} d^{2} + 2 \, a c^{2} d^{3} + a c d^{4} - a d^{5}\right )} \sqrt {-c^{2} + d^{2}}} - \frac {\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a c^{3} - 3 \, a c^{2} d + 3 \, a c d^{2} - a d^{3}} + \frac {6 \, c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 \, c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 \, d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 6 \, c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 7 \, c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (a c^{5} - a c^{4} d - 2 \, a c^{3} d^{2} + 2 \, a c^{2} d^{3} + a c d^{4} - a d^{5}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )}^{2}}}{f} \]

input
integrate(sec(f*x+e)/(a+a*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="gia 
c")
 
output
-(3*(2*c^2*d + 2*c*d^2 + d^3)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(-2*c + 
 2*d) + arctan(-(c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^ 
2 + d^2)))/((a*c^5 - a*c^4*d - 2*a*c^3*d^2 + 2*a*c^2*d^3 + a*c*d^4 - a*d^5 
)*sqrt(-c^2 + d^2)) - tan(1/2*f*x + 1/2*e)/(a*c^3 - 3*a*c^2*d + 3*a*c*d^2 
- a*d^3) + (6*c^2*d^2*tan(1/2*f*x + 1/2*e)^3 - 3*c*d^3*tan(1/2*f*x + 1/2*e 
)^3 - 3*d^4*tan(1/2*f*x + 1/2*e)^3 - 6*c^2*d^2*tan(1/2*f*x + 1/2*e) - 7*c* 
d^3*tan(1/2*f*x + 1/2*e) - d^4*tan(1/2*f*x + 1/2*e))/((a*c^5 - a*c^4*d - 2 
*a*c^3*d^2 + 2*a*c^2*d^3 + a*c*d^4 - a*d^5)*(c*tan(1/2*f*x + 1/2*e)^2 - d* 
tan(1/2*f*x + 1/2*e)^2 - c - d)^2))/f
 
3.3.16.9 Mupad [B] (verification not implemented)

Time = 14.58 (sec) , antiderivative size = 379, normalized size of antiderivative = 1.83 \[ \int \frac {\sec (e+f x)}{(a+a \sec (e+f x)) (c+d \sec (e+f x))^3} \, dx=\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{a\,f\,{\left (c-d\right )}^3}-\frac {\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (d^3+6\,c\,d^2\right )}{c+d}+\frac {3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (-2\,c^2\,d^2+c\,d^3+d^4\right )}{{\left (c+d\right )}^2}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,a\,c^5-6\,a\,c^4\,d+4\,a\,c^3\,d^2+4\,a\,c^2\,d^3-6\,a\,c\,d^4+2\,a\,d^5\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (a\,c^5-5\,a\,c^4\,d+10\,a\,c^3\,d^2-10\,a\,c^2\,d^3+5\,a\,c\,d^4-a\,d^5\right )-a\,c^5+a\,d^5-2\,a\,c^2\,d^3+2\,a\,c^3\,d^2-a\,c\,d^4+a\,c^4\,d\right )}+\frac {d\,\mathrm {atan}\left (\frac {1{}\mathrm {i}\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c^4-4{}\mathrm {i}\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c^3\,d+6{}\mathrm {i}\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c^2\,d^2-4{}\mathrm {i}\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,c\,d^3+1{}\mathrm {i}\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,d^4}{\sqrt {c+d}\,{\left (c-d\right )}^{7/2}}\right )\,\left (2\,c^2+2\,c\,d+d^2\right )\,3{}\mathrm {i}}{a\,f\,{\left (c+d\right )}^{5/2}\,{\left (c-d\right )}^{7/2}} \]

input
int(1/(cos(e + f*x)*(a + a/cos(e + f*x))*(c + d/cos(e + f*x))^3),x)
 
output
tan(e/2 + (f*x)/2)/(a*f*(c - d)^3) - ((tan(e/2 + (f*x)/2)*(6*c*d^2 + d^3)) 
/(c + d) + (3*tan(e/2 + (f*x)/2)^3*(c*d^3 + d^4 - 2*c^2*d^2))/(c + d)^2)/( 
f*(tan(e/2 + (f*x)/2)^2*(2*a*c^5 + 2*a*d^5 + 4*a*c^2*d^3 + 4*a*c^3*d^2 - 6 
*a*c*d^4 - 6*a*c^4*d) - tan(e/2 + (f*x)/2)^4*(a*c^5 - a*d^5 - 10*a*c^2*d^3 
 + 10*a*c^3*d^2 + 5*a*c*d^4 - 5*a*c^4*d) - a*c^5 + a*d^5 - 2*a*c^2*d^3 + 2 
*a*c^3*d^2 - a*c*d^4 + a*c^4*d)) + (d*atan((c^4*tan(e/2 + (f*x)/2)*1i + d^ 
4*tan(e/2 + (f*x)/2)*1i - c*d^3*tan(e/2 + (f*x)/2)*4i - c^3*d*tan(e/2 + (f 
*x)/2)*4i + c^2*d^2*tan(e/2 + (f*x)/2)*6i)/((c + d)^(1/2)*(c - d)^(7/2)))* 
(2*c*d + 2*c^2 + d^2)*3i)/(a*f*(c + d)^(5/2)*(c - d)^(7/2))